package com.vo;

import com.bean.Cinema;

import java.io.Serializable;

public class CinemaVo implements Serializable {
    private String id;
    private String hall;
    private String seat;
    private String type;
    private String state;
    private String spare;

    public Cinema parse(){
        Cinema c = new Cinema();
        try {
            c.setId(Integer.valueOf(this.id));
        } catch (NumberFormatException e) {
        }


        try {
            c.setSeat(Integer.valueOf(this.seat));
        } catch (NumberFormatException e) {
        }


        try {
            c.setType(Integer.valueOf(this.type));
        } catch (NumberFormatException e) {
        }


        try {
            c.setState(Integer.valueOf(this.state));
        } catch (NumberFormatException e) {
        }


         try {
             c.setSpare(Integer.valueOf(this.spare));
        } catch (NumberFormatException e) {
        }


        c.setHall(this.hall);
        return c;
    }

    public CinemaVo(String id, String hall, String seat, String type, String state, String spare) {
        this.id = id;
        this.hall = hall;
        this.seat = seat;
        this.type = type;
        this.state = state;
        this.spare = spare;
    }

    @Override
    public String toString() {
        return "CinemaVo{" +
                "id='" + id + '\'' +
                ", hall='" + hall + '\'' +
                ", seat='" + seat + '\'' +
                ", type='" + type + '\'' +
                ", state='" + state + '\'' +
                ", spare='" + spare + '\'' +
                '}';
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getHall() {
        return hall;
    }

    public void setHall(String hall) {
        this.hall = hall;
    }

    public String getSeat() {
        return seat;
    }

    public void setSeat(String seat) {
        this.seat = seat;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public String getSpare() {
        return spare;
    }

    public void setSpare(String spare) {
        this.spare = spare;
    }
}
